package tue.cse.advanceddatabases.project.db.comment;

import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;

import org.dom4j.Element;

public class CommentsParser {
	private static Logger logger = Logger.getLogger(CommentsParser.class.getName());
	
	public static List<Comment> parse(List<Element> commentsElement) {
		List<Comment> comments = new Vector<Comment>();
		
		List<Element> commentElements = commentsElement.get(0).elements();
		
		logger.info("Number of Comments are:" + commentElements.size());
		for (int i=0; i< commentElements.size();i++){
			Element element = commentElements.get(i);
			comments.add(new Comment(element));
		}
		return comments;
	}
}
